home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
graphics
/
switchf.arc
/
aline.h
< prev
next >
Wrap
C/C++ Source or Header
|
1987-08-24
|
27KB
|
562 lines
/***********************************************\
* *
* aline.h *
* Common include file for C interface *
* to low level Line A calls *
* *
* J.R. Bammi *
* decvax!cwruecmp!bammi *
* bammi%cwru.edu.CSNET *
* bammi@cwru.edu.ARPA *
* CIS: 71515,155 *
* *
\***********************************************/
#include "compiler.h" /* Compiler dependent defines */
/*****************************************************************************\
* *
* Defines *
* *
\*****************************************************************************/
/*
* Object colors (default pallette)
*
*/
#define WHITE 0
#define BLACK 1
#define RED 2
#define GREEN 3
#define BLUE 4
#define CYAN 5
#define YELLOW 6
#define MAGENTA 7
#define LWHITE 8
#define LBLACK 9
#define LRED 10
#define LGREEN 11
#define LBLUE 12
#define LCYAN 13
#define LYELLOW 14
#define LMAGENTA 15
/*
* Vdi writing modes
*
*/
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/*
* Raster Op Codes
*
*/
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 11
#define S_OR_NOTD 12
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/*
* Sprite formats
*
*/
#define SP_VDI 0
#define SP_XOR 1
/*
* Line A Opcodes
*
*/
#define INIT 0
#define PUTPIXEL 1
#define GETPIXEL 2
#define LINE 3
#define HLINE 4
#define RECTANGLE 5
#define FPOLYGON 6
#define BITBLT 7
#define TEXTBLT 8
#define SHOWMOUSE 9
#define HIDEMOUSE 10
#define TRANMOUSE 11
#define USPRITE 12
#define DSPRITE 13
#define CPYRASTER 14
#define FSEEDFILL 15 /* ROM TOS only */
/*****************************************************************************\
* *
* Types *
* *
\*****************************************************************************/
/*
* Global Variables at negative offsets from the Line A parameter
* block address returned by init. (I have no way of telling if this
* list is complete).
*
*/
/* Name Offset Type Description */
/* --------------------------------------------------------------------------*/
/* V_Y_MAX -4 W Max Y pixel value of the screen */
/* V_STATUS -6 W Text Status byte */
/* Bit Field Zero One */
/* 0 cursor flash disabled enabled */
/* 1 flash state off on */
/* 2 cursor visible no yes */
/* 3 end of line no-wrap wrap */
/* 4 inverse video on off */
/* 5 cursor saved false true */
/* V_OFF_AD -10 L Font offset table address */
/* V_X_MAX -12 W Max X pixel value */
/* V_FNT_WR -14 W Width of Font Form in bytes (see type FONT below) */
/* V_FNT_ST -16 W First font ASCII code (first_ade) */
/* V_FNT_ND -18 W Last font ASCII code (last_ade ) */
/* V_FNT_AD -22 L Font Form address */
/* Mono Spaced, 8 pixels wide and byte aligned, any ht. */
/* V_CUR_TIM -23 B Cursor countdown timer */
/* V_CUR_CNT -24 B Cursor flash interval( in frames) */
/* V_CUR_CY -26 W Y cursor position */
/* V_CUR_CX -28 W X cursor position */
/* V_CUR_OFF -30 W Offset from screen base to first cell (bytes) */
/* V_CUR_AD -34 L Current cursor address */
/* V_COL_FG -36 W Foreground color index */
/* V_COL_BG -38 W Background color index */
/* V_CEL_WR -40 W Offset to next vertical cell (bytes) */
/* V_CEL_MY -42 W Max cells high - 1 */
/* V_CEL_MX -44 W Max cells across - 1 */
/* V_CEL_HT -46 W Cell height in pixels (font form's height) */
/* --------------------------------------------------------------------------*/
/*
* Atari finally named these variables
* so here they are
*
*/
typedef struct {
WORD V_CEL_HT; /* *((WORD *)((char *)aline - (char *)46L)) */
WORD V_CEL_MX; /* *((WORD *)((char *)aline - (char *)44L)) */
WORD V_CEL_MY; /* *((WORD *)((char *)aline - (char *)42L)) */
WORD V_CEL_WR; /* *((WORD *)((char *)aline - (char *)40L)) */
WORD V_COL_BG; /* *((WORD *)((char *)aline - (char *)38L)) */
WORD V_COL_FG; /* *((WORD *)((char *)aline - (char *)36L)) */
char *V_CUR_AD; /* *((char **)((char **)aline - (char **)34L)) */
WORD V_CUR_OFF; /* *((WORD *)((char *)aline - (char *)30L)) */
WORD V_CUR_CX; /* *((WORD *)((char *)aline - (char *)28L)) */
WORD V_CUR_CY; /* *((WORD *)((char *)aline - (char *)26L)) */
WORD V_CUR_CNT; /* *((char *)((char *)aline - (char *)24L)) */
/* char V_CUR_TIM; *((char *)((char *)aline - (char *)23L)) */
char **V_FNT_AD; /* *((char **)((char **)aline - (char **)22L)) */
WORD V_FNT_ND; /* *((WORD *)((char *)aline - (char *)18L)) */
WORD V_FNT_ST; /* *((WORD *)((char *)aline - (char *)16L)) */
WORD V_FNT_WR; /* *((WORD *)((char *)aline - (char *)14L)) */
WORD V_X_MAX; /* *((WORD *)((char *)aline - (char *)12L)) */
char **V_OFF_AD; /* *((char **)((char **)aline - (char **)10L)) */
WORD V_STATUS; /* *((WORD *)((char *)aline - (char *) 6L)) */
WORD V_Y_MAX; /* *((WORD *)((char *)aline - (char *) 4L)) */
WORD xxdummy; /* *((WORD *)((char *)aline - (char *) 2L)) */
} NLINEA;
/* A pointer to the type LINEA is returned by the Line A init call
* ($A000), in registers A0 and D0.
* This pointer is saved in the global variable 'aline'.
*
*/
typedef struct {
/* Type Name Offset Function Comments */
/* ------------------------------------------------------------------------- */
WORD VPLANES; /* 0 # of Planes Also see CurrRez */
WORD VWRAP; /* 2 Bytes / scan line " " " */
/* VWRAP can be changed to implement special effect*/
/* Doubling VWRAP will skip every other scan line */
/* */
/* */
WORD *CONTRL; /* 4 Ptr to CONTRL Array Contrl gets set to this */
WORD *INTIN; /* 8 Ptr to INTIN Array Intin gets set to this */
WORD *PTSIN; /* 12 Ptr to PTSIN Array Ptsin gets set to this */
WORD *INTOUT; /* 16 Ptr to INTOUT Array Intout gets set to this */
WORD *PTSOUT; /* 20 Ptr to PTSOUT Array Ptsout gets set to this */
/* CONTRL is the control array */
/* INTIN is the array of input parameters */
/* PTSIN is the array of input coordinates */
/* Even entrys are X coordinate */
/* Odd entrys are corresponding Y coodinates */
/* INTOUT is the array of output parameters */
/* PTSOUT is the array of output coordinates */
/* organizes like PTSIN. */
/* */
WORD COLBIT0; /* 24 Plane 0 Color Value All Three Rez's */
WORD COLBIT1; /* 26 Plane 1 Color Value Med and Low Rez only */
WORD COLBIT2; /* 28 Plane 2 Color Value Low Rez only */
WORD COLBIT3; /* 30 Plane 3 Color Value Low Rez Only */
/* Foreground color COLBIT0 + 2*COLBIT1 + 4*COLBIT2*/
/* + 8*COLBIT3 */
/* */
/* */
WORD LSTLIN; /* 32 Always set to -1, Done for you in init_aline() */
/* Does anyone know what it is supposed to be? */
/*